#define _CRT_SECURE_NO_WARNINGS
#include"list.h"
namespace mutou
{
	struct C
	{
		int a ;
		int b;
		C(int a = 2,int b = 1)
			:a(a)
			,b(b)
		{
		}
	};
	void test01()
	{
		list<int> lt;
		lt.push_back(1);
		lt.push_back(2);
		lt.push_back(3);
		lt.push_back(4);
		lt.push_back(5);
		list<int>::iterator it = lt.begin();
		while (it != lt.end())
		{
			(*it) += 10;
			cout << *it << " ";
			++it;

		}
	}
	void print(const list<int>& s)
	{
		for (auto& ch : s)
		{
			cout << ch << " ";
		}
		cout << endl;
		cout << s.size();
	}
	void test02()
	{
		list<int> llt = { 1,2,3,4,5 };
		list<int> lt;
		list<int> lllt = llt;
		print(llt);
		lt.push_front(1);
		lt.push_front(2);
		lt.push_front(3);
		lt.push_front(4);
		lt.push_front(5);
		lt.pop_back();
		lt.pop_front();
		for (auto& ch : lt)
		{
			cout << ch << " ";
		}
		cout << endl;
		cout << lt.size();
	}
	void test03()
	{
		list<C> c;
		c.push_back({ 1,2 });
		c.push_back({ 4,3 });
		c.push_back({ 5,2 });
		auto it = c.begin();
		while (it != c.end())
		{
			//cout << it->a << it->b << " ";
			cout << it.operator->()->a << it.operator->()->b << " ";
			it++;
		}
		cout << endl;
	}
}
void test1111(const mutou::list<int>& lt)
{
	mutou::list<int>::const_reverse_iterator rit = lt.crbegin();
	while (rit != lt.crend())
	{
		//*rit = 1;
		cout << *rit << " ";
		++rit;
	}
	cout << endl;
}
int main()
{
	//mutou::test03();
	mutou::list<int> lt = { 1,2,3,4 };
	test1111(lt);
	//list<int> l = {1,2,3,4};
	//list<int> lt = { 1,2,3,4,5,7,6 };
	//l.splice(l.begin(), lt);
	//for (auto ch : l)
	//{
	//	cout << ch << " ";
	//}
	//cout << endl;
	//for (auto ch : lt)
	//{
	//	cout << ch << " ";
	//}
	//cout << endl;

	
	return 0;
}